﻿namespace TimeTable.Domain.Entity
{
    public class Division
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int Head { get; set; }
        public Division Parent { get; set; }
        public DivisionType Type { get; set; }

        public override string ToString()
        {
            switch (Type)
            {
                case DivisionType.University: return Name;
                case DivisionType.Faculty: return string.Format("{0} / {1}", Name, Parent.Name);
                case DivisionType.Chair: return string.Format("{0} / {1} / {2}", Name, Parent.Name, Parent.Parent.Name);
            }

            return Name;
        }
    }
}
